#ifndef WEBSERVER_H
#define WEBSERVER_H

#include <QtWebSockets/QWebSocketServer>
#include <QObject>
#include <QHostAddress>
#include <QWebSocket>

class WebServer : public QWebSocketServer
{
    Q_OBJECT
public:
    WebServer(const QString &serverName=QString(), QWebSocketServer::SslMode securMode=QWebSocketServer::NonSecureMode, QObject* parent=0);

    QWebSocket *socket;

    void start(const QString &ip, int port);
    void sendData(QString data);
public slots:
    void newConnected();
    void disconnected();
    void recvData(QString data);

signals:
//    void sendData(const QString &ip, int port, const QString &data);
    void receiveData(const QString &data);
    void clientConnected();
    void clientDisconnected();

};

#endif // WEBSERVER_H
